feat(slack): add unfurl_links/unfurl_media control to send_message#30
Conversation
- Callers can suppress Slack's link/media preview cards (e.g. a digest of many links that would otherwise unfurl into a wall of cards) while keeping the links themselves clickable. - SlackClient.send_message gains optional unfurl_links / unfurl_media params (default None). - Params are forwarded to chat_postMessage only when explicitly set, so every existing caller keeps Slack's default behavior. Backwards compatibility: additive optional params, default None. Existing callers (and their call assertions) are byte-for-byte unchanged; a second test locks in the omit-when-unset behavior.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
WalkthroughAdded optional ChangesUnfurl Parameter Support
Estimated code review effort: 1 (Trivial) | ~5 minutes Sequence Diagram(s)sequenceDiagram
participant Caller
participant SlackClient
participant SlackAPI
Caller->>SlackClient: send_message(unfurl_links, unfurl_media)
SlackClient->>SlackClient: build kwargs dict
alt unfurl_links or unfurl_media not None
SlackClient->>SlackClient: add flags to kwargs
end
SlackClient->>SlackAPI: chat_postMessage(kwargs)
SlackAPI-->>SlackClient: response
SlackClient-->>Caller: bool result
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning Review ran into problems🔥 ProblemsErrors were encountered while retrieving linked issues. Errors (1)
Comment |
Summary
SlackClient.send_messagegains optionalunfurl_links/unfurl_mediaparams (defaultNone).chat_postMessageonly when explicitly set, so every existing caller keeps Slack's default behavior.Backwards compatibility
None. When both are unset,chat_postMessageis called with exactlychannel/text/blocks/attachments(no unfurl keys), byte-for-byte the prior behavior. Theis not Noneguard meansunfurl_links=Falseis forwarded, not dropped by a truthiness check. A dedicated test locks in the omit-when-unset path.Review
is not Noneguard forwardsFalse).Changes
nui_shared_utils/slack_client.py: two optional params + conditional kwargs pass-through.tests/test_slack_client.py: forward-when-set and omit-when-unset tests.Test plan
chat_postMessagewhen settest_slack_client.pygreen (45 passed)Summary by CodeRabbit
New Features
Tests